<!doctype html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link href="css/mui.min.css" rel="stylesheet" />
	</head>

	<body>
		<div class="mui-content">
			<ul class="mui-table-view">
			    <li class="mui-table-view-cell mui-media">
			    		<img class="mui-media-object mui-pull-left" src="image/friends.png" style="max-height: 24px;max-width: 24px;">
			        <p class='mui-ellipsis'>
			        		<span style="line-height: 25px;color: black;font-size: 16px;margin-left: 5px;">朋友圈</span>
			        </p>
			    </li>
			</ul>
			<ul class="mui-table-view" style="margin-top: 20px;">
			    <li id="add_friend" class="mui-table-view-cell mui-media">
			    		<img class="mui-media-object mui-pull-left" src="image/addfriends.png" style="max-height: 24px;max-width: 24px;">
			        <p class='mui-ellipsis'>
			        		<span style="line-height: 25px;color: black;font-size: 16px;margin-left: 5px;">添加好友</span>
			        </p>
			    </li>
			    <li id="scan_qrcode" class="mui-table-view-cell mui-media">
			    		<img class="mui-media-object mui-pull-left" src="image/scanscan.png" style="max-height: 24px;max-width: 24px;">
			        <p class='mui-ellipsis'>
			        		<span style="line-height: 25px;color: black;font-size: 16px;margin-left: 5px;">扫一扫</span>
			        </p>
			    </li>
			</ul>
			<ul class="mui-table-view" style="margin-top: 20px;">
			    <li class="mui-table-view-cell mui-media">
			    		<img class="mui-media-object mui-pull-left" src="image/book.png" style="max-height: 24px;max-width: 24px;">
			        <p class='mui-ellipsis'>
			        		<span style="line-height: 25px;color: black;font-size: 16px;margin-left: 5px;">阅读器</span>
			        </p>
			    </li>
			    	<li class="mui-table-view-cell mui-media">
			    		<img class="mui-media-object mui-pull-left" src="image/txanime.png" style="max-height: 24px;max-width: 24px;">
			        <p class='mui-ellipsis'>
			        		<span style="line-height: 25px;color: black;font-size: 16px;margin-left: 5px;">动漫</span>
			        </p>
			    </li>
			</ul>
		</div>
		
		<script src="js/app.js" type="text/javascript" ></script>
		<script src="js/mui.min.js"></script>
		<script type="text/javascript">
			mui.init();
			var friends;
			mui.plusReady(function() {
				var thisWebView = plus.webview.currentWebview();
				thisWebView.addEventListener("show",function(){
					var fr_user_info = app.getUserInfo();
					loadFriendRequest(fr_user_info.userId);
				});
				var scan_qrcode = document.getElementById("scan_qrcode");
				scan_qrcode.addEventListener("tap",function(){
					mui.openWindow("my/scan_qrcode.html","scan_qrcode.html");
				});				
				var add_friend = document.getElementById("add_friend");
				add_friend.addEventListener("tap",function(){
					mui.openWindow({
						url: "discover/addfriend.html",
					    id: "addfriend.html"
					});
				})
			})
			function loadFriendRequest(userId){
				var url = app.serverUrl + "/f/queryFriendRequest?userId=" + userId;
				mui.ajax(url,{
					dataType:'json',//服务器返回json格式数据
					type:'post',//HTTP请求类型
					timeout:10000,//超时时间设置为10秒；
					headers:{'Content-Type':'application/json'},	              
					success:function(data){
						if(data.status == 200){
							friends = data.data;
						}else{
							app.showToast(data.msg, "error");	
						}
					},
					error:function(xhr,type,errorThrown){
//						app.Error();
					}
				});
			}
		</script>
	</body>

</html>